package com.yupi.springbootinit.controller;


import com.yupi.springbootinit.annotation.AuthCheck;
import com.yupi.springbootinit.common.BaseResponse;
import com.yupi.springbootinit.common.ResultUtils;
import com.yupi.springbootinit.constant.UserConstant;
import com.yupi.springbootinit.mapper.VipuserlistMapper;
import com.yupi.springbootinit.model.entity.Vipuserlist;
import com.yupi.springbootinit.service.VipuserlistService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/viplist")
@Slf4j
public class VipUserListController {

    @Resource
    private VipuserlistService vipuserlistService;

    @GetMapping("/list")
    @AuthCheck(mustRole = UserConstant.ADMIN_ROLE)
    public BaseResponse<List<Vipuserlist>> list() {
        List<Vipuserlist> list = vipuserlistService.list();
        return ResultUtils.success(list);
    }
}
